# coding: utf-8
from sqlalchemy import Column, DECIMAL, DateTime, Float, String, TIMESTAMP, text
from sqlalchemy.dialects.mysql import BIGINT, INTEGER, TINYINT
from sqlalchemy.ext.declarative import declarative_base

Base = declarative_base()
metadata = Base.metadata


class QianniuDouyinFlow(Base):
    __tablename__ = 'qianniu_douyin_flow'

    id = Column(INTEGER(11), primary_key=True)
    crawl_time = Column(TIMESTAMP, nullable=False, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"))
    activity_id = Column(String(30))
    activity_name = Column(String(255))
    cell_title = Column(String(100))
    gmt_create = Column(TIMESTAMP)
    gmt_modified = Column(TIMESTAMP)
    ext_id = Column(String(30))
    item_id = Column(String(50))
    main_accountId = Column(String(30))
    status = Column(TINYINT(4))
    tkl_url = Column(String(100))
    day_pvs = Column(Float(12, True))
    day_uvs = Column(Float(12, True))
    day_one_val_orders = Column(Float(12, True))
    day_one_val_order_gmvs = Column(Float(12, True))
    day_goods_collects = Column(Float(12, True))
    day_cart_pv = Column(Float(12, True))
    day_pvs_7 = Column(Float(12, True))
    day_uvs_7 = Column(Float(12, True))
    day_one_val_orders_7 = Column(Float(12, True))
    day_one_val_order_gmvs_7 = Column(Float(12, True))
    day_goods_collects_7 = Column(Float(12, True))
    day_cart_pv_7 = Column(Float(12, True))
    day_pvs_15 = Column(Float(12, True))
    day_uvs_15 = Column(Float(12, True))
    day_one_val_orders_15 = Column(Float(12, True))
    day_one_val_order_gmvs_15 = Column(Float(12, True))
    day_goods_collects_15 = Column(Float(12, True))
    day_cart_pv_15 = Column(Float(12, True))
    day_pvs_30 = Column(Float(12, True))
    day_uvs_30 = Column(Float(12, True))
    day_one_val_orders_30 = Column(Float(12, True))
    day_one_val_order_gmvs_30 = Column(Float(12, True))
    day_goods_collects_30 = Column(Float(12, True))
    day_cart_pv_30 = Column(Float(12, True))


class SeleFoolBrowser(Base):
    __tablename__ = 'sele_fool_browser'

    id = Column(INTEGER(11), primary_key=True)
    job_name = Column(String(30))
    init_cmd = Column(String(255))
    is_init_run = Column(TINYINT(4))
    next_time_delta = Column(INTEGER(4))
    ucommand = Column(String(255))
    create_time = Column(DateTime)


